package com.daisuxia.task;

import java.util.Calendar;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.daisuxia.back.service.IBackStatisticService;
import com.daisuxia.web.service.IThirdChannelReportService;
import com.daisuxia.web.util.DateUtil;

import redis.clients.jedis.JedisCluster;

/**
 * 
 * @author lgy
 * 
 *
 */

public class DataStatisticTaskService {
	private static Logger logger = LoggerFactory.getLogger(DataStatisticTaskService.class);
	
	@Autowired
	JedisCluster jedisCluster;
	
	@Autowired
	private IBackStatisticService backStatisticService;
	
	@Autowired
	private IThirdChannelReportService thirdChannelReportService;
	
	/**
	 * 平台全报告
	 */
	public void insertReport() {
		logger.error("insertReport is running");
		Calendar now = Calendar.getInstance();
		now.add(Calendar.DAY_OF_YEAR, -1);
		backStatisticService.updateReport(now, now);

		/*try {
			logger.error("thirdChannelReport pushreport start ---------------");
			String nowTime = DateUtil.getDateFormat(now.getTime(), "yyyy-MM-dd");
			thirdChannelReportService.pushUserReport(nowTime);
			logger.error("thirdChannelReport pushreport end ---------------");
		} catch (Exception e) {
			logger.error("thirdChannelReport error", e);
		}*/
	}
}